// components/item-components/goods-type-component.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    optionItem: {
      type: Object,
      value: {}
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    icon_normal: '/images/icon_detail_sweetness_normal.png',
    icon_selected: '/images/icon_detail_sweetness_selected.png'
  },
  ready:function(){
  },
  /**
   * 组件的方法列表
   */
  methods: {
    //  点击展开操作
    _onClick: function (event) {
      var tmpItem = this.data.optionItem;
      tmpItem.show = !tmpItem.show;
      this.triggerEvent('click', tmpItem, "myEventOption")
    },

    //  点击选择操作
    _onSelected: function (event) {
      var tmpItem = this.data.optionItem;
      tmpItem.checked = event.detail.checked;
      this.triggerEvent('selected', tmpItem, "myEventOption")
    },
  }
})
